<?php
defined( '_VALID_MOS' ) or die( 'Restricted access' );
function com_install() {
    global $database;

    $database -> setQuery("UPDATE #__components SET admin_menu_link = '' WHERE name = '.Subscription Plans' AND parent = 0");
    $database -> query();

    $database -> setQuery("SELECT id FROM #__components WHERE name= '.Subscription Plans' AND parent = 0 AND `link` = 'option=com_jcs'");
    $id = $database -> loadResult();

    // remove admin menu images
    $database -> setQuery("UPDATE #__components SET admin_menu_img = '../administrator/components/com_jcs/subscription.gif' WHERE id = '$id'");
    $database -> query();

    // add new admin menu images
    
    $database -> setQuery("UPDATE #__components SET admin_menu_img = '../administrator/components/com_jcs/config.png' WHERE parent='$id' AND name = 'Configuration'");
    $database -> query();
    $database -> setQuery("UPDATE #__components SET admin_menu_img = '../administrator/components/com_jcs/subscription.gif' WHERE parent='$id' AND name = 'Subscription Plans'");
    $database -> query();
    $database -> setQuery("UPDATE #__components SET admin_menu_img = '../administrator/components/com_jcs/usubscription.gif' WHERE parent='$id' AND name = 'User Subscriptions'");
    $database -> query();
    $database -> setQuery("UPDATE #__components SET admin_menu_img = '../administrator/components/com_jcs/reports16.png' WHERE parent='$id' AND name = 'Reports'");
    $database -> query();
    $database -> setQuery("UPDATE #__components SET admin_menu_img = 'js/ThemeOffice/categories.png', admin_menu_link = 'option=com_categories&section=com_jcs_plans' WHERE parent='$id' AND name = 'Categories'");
    $database -> query();
}
?>
